//
//  OrderNullView.m
//  有材网
//
//  Created by 肖扬 on 16/1/21.
//  Copyright © 2016年 肖扬. All rights reserved.
//

#import "OrderNullView.h"

@implementation OrderNullView
@synthesize alertImg,alertLab;
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.alertImg= [self createImageViewFrame:CGRectMake((SWIDTH - 47)/2, (frame.size.height - 63)/2, 47, 63) image:nil imageName:@"暂无采购标识" tag:10];
        [self addSubview:self.alertImg];
        
        self.alertLab = [self createLabelFrame:CGRectMake(0, (frame.size.height - 63)/2 + 70, SWIDTH, 14) title:@"暂无相应订单" titleColor:GRAYColor tag:11];
        self.alertLab.font = [UIFont systemFontOfSize:12];
        alertLab.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.alertLab];
    }
    return self;
}
-(void)setImage:(NSString*)imageName{

}
-(void)setLabText:(NSString*)labText{

}
//创建UIImageView tag值为五位数
- (UIImageView *)createImageViewFrame:(CGRect)frame
                                image:(UIImage *)image
                            imageName:(NSString *)imageName
                                  tag:(NSInteger)tag{
    UIImageView *tempImageView = [[UIImageView alloc]initWithFrame:frame];
    [tempImageView setBackgroundColor:[UIColor clearColor]];
    if (image) {
        tempImageView.image = image;
    }else{
        tempImageView.image = [UIImage imageNamed:imageName];
    }
    [tempImageView setTag:tag];
    return tempImageView;
}
//创建UILabel  tag值为三位数
- (UILabel *)createLabelFrame:(CGRect)frame
                        title:(NSString *)title
                   titleColor:(UIColor *)color
                          tag:(NSInteger)tag{
    UILabel *tempLabel = [[UILabel alloc]initWithFrame:frame];
    [tempLabel setBackgroundColor:[UIColor clearColor]];
    [tempLabel setText:title];
    [tempLabel setTag:tag];
    [tempLabel setTextColor:color];
    return tempLabel;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
